<?php

namespace App\Transformers;

use App\Models\Absence;

class AbsenceTransformer extends Transformer
{

    public function transform(Absence $absence)
    {
        return [
            'id'    => $absence->id,
            'name'  => $absence->users->name,
            'department_name'  => $absence->users->department->name,
            'absence_date' => $absence->absence_date,
            'start_time' => $absence->start_time,
            'end_time' => $absence->end_time,
            'minute' => $absence->end_time-$absence->start_time,
            'absence_type' => $absence->absence_type,
            'absence_note' => $absence->absence_note,
        ];


    }
}
